package com.fr.base.core.antlr;

import com.fr.base.core.antlr.collections.AST;

public abstract class ParseTree extends BaseAST
{
  public String getLeftmostDerivationStep(int paramInt)
  {
    if (paramInt <= 0)
      return toString();
    StringBuffer localStringBuffer = new StringBuffer(2000);
    getLeftmostDerivation(localStringBuffer, paramInt);
    return localStringBuffer.toString();
  }

  public String getLeftmostDerivation(int paramInt)
  {
    StringBuffer localStringBuffer = new StringBuffer(2000);
    localStringBuffer.append("    " + toString());
    localStringBuffer.append("\n");
    for (int i = 1; i < paramInt; ++i)
    {
      localStringBuffer.append(" =>");
      localStringBuffer.append(getLeftmostDerivationStep(i));
      localStringBuffer.append("\n");
    }
    return localStringBuffer.toString();
  }

  protected abstract int getLeftmostDerivation(StringBuffer paramStringBuffer, int paramInt);

  public void initialize(int paramInt, String paramString)
  {
  }

  public void initialize(AST paramAST)
  {
  }

  public void initialize(Token paramToken)
  {
  }
}